/*
 * Copyright (c) 2023 iQi.Co.Ltd. All rights reserved.
 */
 
using IQIGame.Onigao.Framework;
using System.Collections.Generic;
using System.Linq;
using System;
using NetProtocol.Enum;

namespace NetProtocol.POD {

	/// <summary>
	/// 
	/// module : levelLogic
	/// </summary>
	public class LevelEntityMapPOD : IPOD 
    {
        public readonly static Func<LevelEntityMapPOD> FACTORY = () => new LevelEntityMapPOD();
		public static Func<LevelEntityMapPOD> DynamicFactory = FACTORY;
        
		/*-- members --*/
		/// <summary>
        /// 
        /// </summary>
		public int id;
		/// <summary>
        /// 
        /// </summary>
		public int mcid;
		/// <summary>
        /// 
        /// </summary>
		public int mapUIEntityCid;
		/// <summary>
        /// 
        /// </summary>
		public int x;
		/// <summary>
        /// 
        /// </summary>
		public int y;
		/// <summary>
        /// 
        /// </summary>
		public int z;
		/// <summary>
        /// 
        /// </summary>
		public int dir;
		/// <summary>
        /// 
        /// </summary>
		public bool isObstacleActive;
		/// <summary>
        /// 
        /// </summary>
		public bool isCheckPoint;
		/// <summary>
        /// 
        /// </summary>
		public bool isCheckPointActive;
		/// <summary>
        /// 
        /// </summary>
		public bool isOfferingQuest;
		
		
		
		/*-- constructors --*/
		public LevelEntityMapPOD() {}
		public LevelEntityMapPOD(int id, int mcid, int mapUIEntityCid, int x, int y, int z, int dir, bool isObstacleActive, bool isCheckPoint, bool isCheckPointActive, bool isOfferingQuest) {
			this.id = id;
			this.mcid = mcid;
			this.mapUIEntityCid = mapUIEntityCid;
			this.x = x;
			this.y = y;
			this.z = z;
			this.dir = dir;
			this.isObstacleActive = isObstacleActive;
			this.isCheckPoint = isCheckPoint;
			this.isCheckPointActive = isCheckPointActive;
			this.isOfferingQuest = isOfferingQuest;
		}
	      public void Serial(SOutputStream _out) {
            _out.Write_int(id);
            _out.Write_int(mcid);
            _out.Write_int(mapUIEntityCid);
            _out.Write_int(x);
            _out.Write_int(y);
            _out.Write_int(z);
            _out.Write_int(dir);
            _out.Write_boolean(isObstacleActive);
            _out.Write_boolean(isCheckPoint);
            _out.Write_boolean(isCheckPointActive);
            _out.Write_boolean(isOfferingQuest);
        }
        
        public void UnSerial(SInputStream _in) {
            if(!_in.HasRemaining()) return;
            id = _in.Read_int();
            if(!_in.HasRemaining()) return;
            mcid = _in.Read_int();
            if(!_in.HasRemaining()) return;
            mapUIEntityCid = _in.Read_int();
            if(!_in.HasRemaining()) return;
            x = _in.Read_int();
            if(!_in.HasRemaining()) return;
            y = _in.Read_int();
            if(!_in.HasRemaining()) return;
            z = _in.Read_int();
            if(!_in.HasRemaining()) return;
            dir = _in.Read_int();
            if(!_in.HasRemaining()) return;
            isObstacleActive = _in.Read_boolean();
            if(!_in.HasRemaining()) return;
            isCheckPoint = _in.Read_boolean();
            if(!_in.HasRemaining()) return;
            isCheckPointActive = _in.Read_boolean();
            if(!_in.HasRemaining()) return;
            isOfferingQuest = _in.Read_boolean();
        }
		
		public LevelEntityMapPOD Clone() {
            LevelEntityMapPOD o = DynamicFactory();
            o.id = id;
            o.mcid = mcid;
            o.mapUIEntityCid = mapUIEntityCid;
            o.x = x;
            o.y = y;
            o.z = z;
            o.dir = dir;
            o.isObstacleActive = isObstacleActive;
            o.isCheckPoint = isCheckPoint;
            o.isCheckPointActive = isCheckPointActive;
            o.isOfferingQuest = isOfferingQuest;
            return o;
        }
        
        public void Clear() {
            id = default;
            mcid = default;
            mapUIEntityCid = default;
            x = default;
            y = default;
            z = default;
            dir = default;
            isObstacleActive = default;
            isCheckPoint = default;
            isCheckPointActive = default;
            isOfferingQuest = default;
        }
		
        public override string ToString() {
			string str = "";
			str += "LevelEntityMapPOD [";
			str += "id=";
			str += id;
			str += ", mcid=";
			str += mcid;
			str += ", mapUIEntityCid=";
			str += mapUIEntityCid;
			str += ", x=";
			str += x;
			str += ", y=";
			str += y;
			str += ", z=";
			str += z;
			str += ", dir=";
			str += dir;
			str += ", isObstacleActive=";
			str += isObstacleActive;
			str += ", isCheckPoint=";
			str += isCheckPoint;
			str += ", isCheckPointActive=";
			str += isCheckPointActive;
			str += ", isOfferingQuest=";
			str += isOfferingQuest;
			str += "]";
			return str;
		}
		
	}
}